<?php
$dsn="mysql:host=localhost;dbname=exam";
$db=new PDO($dsn,'root','');
$db->query('set names utf8');
$result=$db->query('select * from exam0');
$result->setFetchMode(PDO::FETCH_ASSOC);
$insert=$db->prepare ("update exam0 set time=:time, place=:place, teacher=:teacher where course=:course AND class=:class");
while ($row=$result->fetch()){
    $name=$row['course'];
    $class=$row['class'];
    $plcae0=$name."+".$class."+"."place0";
    $plcae1=$name."+".$class."+"."place1";
    $PLACE=$_POST[$plcae0].$_POST[$plcae1];
    $time0=$name."+".$class."+"."time0";
    $time1=$name."+".$class."+"."time1";
    $Time=$_POST[$time0]." ".$_POST[$time1];
    $teacher=$name."+".$class."+"."teacher";
    $TEACHER=$_POST[$teacher];
    $insert->execute(array(':time'=>$Time,':place'=>$PLACE,':teacher'=>$TEACHER,':course'=>$name,':class'=>$class));
}
echo "<script>window.location.href='http://localhost:63342/untitled2/11.11/slecet.php?_ijt=8el42ea120j955ohuqn8q7kmgf';</script>";
?>